function profileSave() {
    var modelType = $("#modelType").val();
    if ($.validate.form()) {
        var baseInfo = {};
        var formArray = $("#form-profile-edit").serializeArray();
        $.each(formArray, function (i, item) {
            baseInfo[item.name] = item.value;
        });
        var description = JSON.stringify(baseInfo);
        $.post("/profile/save.json", {"type": modelType, "description": description}, function (json) {
            if (json.code === 0) {
                $.modal.alert("保存成功", modal_status.SUCCESS);
            } else {
                $.modal.alertError("保存失败", modal_status.FAIL);
            }
        })
    }
}

function sensitiveWordSave() {
    if ($.validate.form()) {
        $.post("/profile/sensitiveword.json", $("#form-profile-edit").serializeArray(),function (json) {
            if(json.code === 0) {
                $.modal.alert("保存成功", modal_status.SUCCESS);
            }else {
                $.modal.alertError(json.msg, modal_status.FAIL);
            }
        })
    }
}